﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using XLua;
using System;
using FairyGUI;

namespace StarForce.Editor
{
//详细说明就去看Xlua的配置.doc
    public static class FairyGuiLuaGenConfig
    {
        //lua 中要使用到C#库的配置，比如C#标准库，或者Unity API，第三方库等。
        [LuaCallCSharp] public static List<Type> LuaCallCSharp = new List<Type>()
        {
            typeof(System.Object),
            typeof(UnityEngine.Object),
            typeof(Vector2),
            typeof(Vector3),
            typeof(Vector4),
            typeof(Quaternion),
            typeof(Color),
            typeof(Ray),
            typeof(Bounds),
            typeof(Ray2D),
            typeof(Time),
            typeof(GameObject),
            typeof(Behaviour),
            typeof(Transform),
            typeof(Resources),
            typeof(TextAsset),
            typeof(Keyframe),
            typeof(AnimationClip),
            typeof(AnimationCurve),
            typeof(MonoBehaviour),
            typeof(Renderer),
            typeof(WWW),
            typeof(UnityEngine.U2D.SpriteAtlas),
            typeof(Sprite),
            typeof(SpriteRenderer),
            typeof(SkinnedMeshRenderer),
            typeof(ParticleSystem),
            typeof(Action<String>),
            typeof(Action<GameObject>),
            typeof(TextAsset),
            typeof(Texture2D),
            typeof(AudioClip),
            typeof(UnityEngine.Debug),
            typeof(System.Collections.Generic.List<int>),
            typeof(DG.Tweening.TweenCallback<Action>),
            typeof(DG.Tweening.Sequence),
            typeof(DG.Tweening.Ease),
            typeof(DG.Tweening.ShortcutExtensions),
            typeof(DG.Tweening.TweenSettingsExtensions),
            typeof(DG.Tweening.ShortcutExtensions),
            typeof(DG.Tweening.Tweener),
            typeof(DG.Tweening.Tween),
            typeof(Timer),
            typeof(FairyGUI.GObject),
            typeof(FairyGUI.GComponent),
            typeof(FairyGUI.UIConfig),
            typeof(FairyGUI.UIPackage),
            typeof(FairyGUI.UIPackage.LoadResource),
            typeof(FairyGUI.UIPanel),
            typeof(FairyGUI.Stage),
            typeof(FairyGUI.EventListener),
            typeof(FairyGUI.UIObjectFactory)
        };

        //C#静态调用LUA的配置（包括事件原型），仅可以配delegate,interface
        [CSharpCallLua] public static List<Type> CSharpCallLua = new List<Type>()
        {
            typeof(Action),
            typeof(Func<double, double, double>),
            typeof(Action<string>),
            typeof(Action<double>),
            typeof(Action<GameObject>),
            typeof(UnityEngine.Events.UnityAction),
            typeof(DG.Tweening.TweenCallback),
            typeof(DG.Tweening.Core.DOGetter<Vector2>),
            typeof(DG.Tweening.Core.DOSetter<Vector2>),
            typeof(System.Collections.IEnumerator),
            typeof(FairyGUI.UIPackage.LoadResource),
            typeof(FairyGUI.EventCallback0),
            typeof(FairyGUI.EventCallback1)
        };

        //黑名单
        public static List<List<string>> BlackList = new List<List<string>>()
        {
            new List<string>() {"UnityEngine.WWW", "movie"},
            new List<string>() {"UnityEngine.Texture2D", "alphaIsTransparency"},
            new List<string>() {"UnityEngine.Security", "GetChainOfTrustValue"},
            new List<string>() {"UnityEngine.CanvasRenderer", "onRequestRebuild"},
            new List<string>() {"UnityEngine.Light", "areaSize"},
            new List<string>() {"UnityEngine.AnimatorOverrideController", "PerformOverrideClipListCleanup"},
#if !UNITY_WEBPLAYER
            new List<string>() {"UnityEngine.Application", "ExternalEval"},
#endif
            new List<string>() {"UnityEngine.GameObject", "networkView"}, //4.6.2 not support
            new List<string>() {"UnityEngine.Component", "networkView"}, //4.6.2 not support
            new List<string>()
                {"System.IO.FileInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
            new List<string>() {"System.IO.FileInfo", "SetAccessControl", "System.Security.AccessControl.FileSecurity"},
            new List<string>()
                {"System.IO.DirectoryInfo", "GetAccessControl", "System.Security.AccessControl.AccessControlSections"},
            new List<string>()
                {"System.IO.DirectoryInfo", "SetAccessControl", "System.Security.AccessControl.DirectorySecurity"},
            new List<string>()
            {
                "System.IO.DirectoryInfo", "CreateSubdirectory", "System.String",
                "System.Security.AccessControl.DirectorySecurity"
            },
            new List<string>() {"System.IO.DirectoryInfo", "Create", "System.Security.AccessControl.DirectorySecurity"},
            new List<string>() {"UnityEngine.MonoBehaviour", "runInEditMode"},
        };
    }
}